package com.csailing4cloud.csailing.user.api.feign;

import com.csailing4cloud.csailing.common.core.util.CsResponse;
import com.csailing4cloud.csailing.user.api.dto.UserInfo;
import com.csailing4cloud.csailing.user.api.entity.CsUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author dyh
 */
@FeignClient(value = "csailing-user-biz")
public interface RemoteUserService {

    /**
     * 通过用户名查询用户信息
     * @param userName
     * @return
     */
    @GetMapping("/user/info/{userName}")
    CsResponse<UserInfo> userInfo(@PathVariable("userName") String userName);

    /**
     * 保存用户信息
     * @param csUser
     * @return
     */
    @PostMapping("/user/info/save")
    CsResponse saveUserInfo(@RequestBody CsUser csUser);
}
